import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/generated/l10n.dart';
import 'package:finance_app/src/widgets/bottom_sheet/delete_info_bottom_sheet.dart';
import 'package:finance_app/src/widgets/bottom_sheet/got_it_tip_bottom_sheet.dart';

mixin DefaultDetailOperationMixin<T> on BaseProvider<T> {
  List<String> menuList = [
    S.current.edit,
    S.current.delete,
  ];

  void onChangeEditMode();

  void onEdit() {
    onChangeEditMode();
  }

  void onDelete() {
    obtainContext?.call((context) async {
      bool isSuccess = await showDeleteTransactionInfoBottomSheet(context);
      if (isSuccess == true) {
        await showDeleteSuccessTipBottomSheet(context);
      }
    });
  }
}
